var TChannel = require('tchannel');
 
var client = new TChannel();
 

var clientChan = client.makeSubChannel({
    serviceName: 'clinet',
    peers: ['127.0.0.1:4040','127.0.0.1:4041'],
    requestDefaults: {
        hasNoParent: true,
        headers: { 'as': 'raw', 'cn': 'example-client' }
    }
});

clientChan.request({
    serviceName: 'server1',
    timeout: 10000
}).send('func1', 'arg 1', 'arg 2', function onResp(err, res, arg2, arg3) {
    console.log('normal res:', arg2, arg3);
    client.close();
    //console.log('normal res:', { arg2: arg2.toString(), arg3: arg3.toString() });
});
 
